package router

import (
	"jgt-oper/src/context"
	"jgt-oper/src/svc"

	"github.com/facebookgo/inject"
	"github.com/teambition/gear"
)

// SvcEnterpriseAccountMap 企业金融账户管理路由映射
func SvcEnterpriseAccountMap(g *inject.Graph, router *gear.Router) {
	enterpriseAccountSvc := new(svc.EnterpriseAccount)
	err := g.Provide(&inject.Object{Value: enterpriseAccountSvc})
	if err != nil {
		panic(err)
	}
	router.Get("/account/account-detail", context.WrapContext(enterpriseAccountSvc.AccountDetail))
	router.Get("/account/query-page", context.WrapContext(enterpriseAccountSvc.QueryPage))
	router.Post("/account/open-account", context.WrapContext(enterpriseAccountSvc.AccountOpen))
	router.Post("/account/pay", context.WrapContext(enterpriseAccountSvc.AccountPay))
	router.Post("/account/account-close", context.WrapContext(enterpriseAccountSvc.AccountClose))
}
